import { Meta } from '@storybook/addon-docs';

<Meta title="Getting Started/Development" id="getting-started-development" />

# Development

## Setup

Install the latest [Node JS LTS](https://nodejs.org/) and [Yarn](https://yarnpkg.com/getting-started/install) and simply run `yarn` or `yarn install` command in the root and stories directory.

> It is advised to run the script whenever NPM packages are installed.

## Local development

During development:

```sh
# watch and build new source changes
yarn start
# or serve *.stories.js files and manually test on the Storybook app
yarn storybook
```

## Including NPM packages

This project uses two package.json structure

### Library dependencies

```sh
yarn add [package-name] --dev # for dev tools
yarn add [package-name] # for app
```

## Lint

```sh
yarn lint # runs linter to detect any style issues (css & js)
yarn lint:css # lint only css
yarn lint:js # lint only js
yarn lint:js --fix # tries to fix js lint issues
```

## Test

```sh
yarn test:tdd # runs functional/unit tests using Jest with watcher
yarn test # runs functional/unit tests using Jest
yarn test --coverage # with coverage
```

## Build

```sh
yarn build # builds sources at src/
```
